package com.cskaoyan.day4;

import java.util.Arrays;

public class StringArray {
    public static void main(String[] args) {
        String[] arr = {"JavaSE", "JavaEE", "MySQL", "JDBC", "Tomcat", "Servlet", "request", "response",
                "Filter", "Listener", "Cookie", "Session", "Maven", "Spring",
                "SpringMVC", "MyBatis", "SpringBoot", "Redis", "GC", "..."};
        printStringArray(arr);
    }

    private static void printStringArray(String[] arr) {
        System.out.println("方式一：下标");
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
        System.out.println();
        System.out.println();

        System.out.println("方式二：Arrays.toString()");
        System.out.println(Arrays.toString(arr));

        System.out.println();
        System.out.println("方式三：iter");
        for (String s : arr) {
            System.out.print(s + " ");
        }
    }
}
